package org.jeecg.modules.scm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.flow.query.HistoryActivityQuery;
import org.jeecg.modules.flow.query.HistoryTaskQuery;
import org.jeecg.modules.flow.query.SubmitTaskQuery;
import org.jeecg.modules.scm.dto.ScmReceivablesTransferApplicationDto;
import org.jeecg.modules.scm.dto.TransferApplicationQueryPageDto;
import org.jeecg.modules.scm.entity.ScmCloudChain;
import org.jeecg.modules.scm.entity.ScmReceivablesTransferApplication;
import org.jeecg.modules.scm.vo.ScmReceivablesTransferApplicationVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * @Description: scm_receivables_transfer_application
 * @Author: jeecg-boot
 * @Date: 2021-11-09
 * @Version: V1.0
 */
public interface IScmReceivablesTransferApplicationService extends IService<ScmReceivablesTransferApplication> {
    /**
     * 上传贸易合同
     * @param file 贸易合同附件
     */
    String uploadContract(MultipartFile file);

    /**
     * 编辑云链单
     * @param applicationDto
     * @return
     */
    Result<?> editApplication(ScmReceivablesTransferApplicationDto applicationDto);

    /**
     * 新增申请表
     * @param scmReceivablesTransferApplicationDto
     * @return
     */
    Result<?> saveScmReceivablesTransferApplication(ScmReceivablesTransferApplicationDto scmReceivablesTransferApplicationDto) throws Exception;

    /**
     * 查找云链单
     * @param id
     * @return
     */
    List<ScmCloudChain> findCloudChain(String id);

    /**
     * 批量提交审批
     * @param transferApplyIds
     * @return
     */
    Map<String,List<String>> approveBatch(List<String> transferApplyIds);

    /**
     * 完成流程节点
     * @param query
     * @return
     */
    Result<?> handleTask(SubmitTaskQuery query);

    /**
     * 进度查询
     * @param query
     * @return
     */
    Result<?> queryProgress(HistoryActivityQuery query);

    /**
     * 查询用户可处理申请
     * @param transferApplicationQueryPageDto
     * @param page
     * @return
     */
    IPage<ScmReceivablesTransferApplicationVo> applicationList(TransferApplicationQueryPageDto transferApplicationQueryPageDto, Page<?> page);

    /**
     * 删除申请
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除申请
     * @param ids
     */
    void deleteBatch(List<String> ids);

}
